<?php
$dsn = "sqlsrv:Server=localhost;Database=Student";
$db = new PDO($dsn, "sa", "123456");

//删除Student表id=10的学生记录：
$deleteSql = "DELETE FROM [dbo].[Student] WHERE StudentId = 10";
$result = $db->exec($deleteSql);
var_dump($result);
if ($result) {
    echo "删除成功，影响行数：" . $result;
} else {
    echo "删除失败";
}